def equation(n):
    equation_list = []
    characters = [] #用于记录+、-、*
    for i in range(n):
        statements = list(input().split(" "))
        equation_list.append(statements)
    for equations in equation_list:
        if len(equations) == 3:
            sign,number1,number2 = equations[0],int(equations[1]),int(equations[2])
            characters.append(sign)
            if sign == 'a':
                print(f'{number1}+{number2}={number1+number2}')
                print(len(f'{number1}+{number2}={number1+number2}'))
            elif sign == 'b':
                print(f'{number1}-{number2}={number1-number2}')
                print(len(f'{number1}-{number2}={number1-number2}'))
            elif sign == 'c':
                print(f'{number1}*{number2}={number1*number2}')
                print(len(f'{number1}*{number2}={number1*number2}'))
        elif len(equations) == 2:
            sign = characters[len(characters)-1]
            number1,number2 = int(equations[0]),int(equations[1])
            if sign == 'a':
                print(f'{number1}+{number2}={number1+number2}')
                print(len(f'{number1}+{number2}={number1+number2}'))
            elif sign == 'b':
                print(f'{number1}-{number2}={number1-number2}')
                print(len(f'{number1}-{number2}={number1-number2}'))
            elif sign == 'c':
                print(f'{number1}*{number2}={number1*number2}')
                print(len(f'{number1}*{number2}={number1*number2}'))


        
num = int(input())
equation(num)

